package com.aaa.controller;

import com.aaa.service.T_AppraiserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: TT
 * @Date: 2019/3/14 21:23
 * @Version 1.0
 */
@Controller
@RequestMapping("/appraiser/")
public class T_AppraiserController {
@Autowired
    T_AppraiserService service;
@RequestMapping("go")
    public  String go(){
        return  "appraiser/appraiser";
    }
@RequestMapping("list")
@ResponseBody
    public  Object list(@RequestBody Map map){
    Map map1=new HashMap();
    map1.put("data",service.list(map));
    map1.put("total",service.count(map));
    map1.put("types",service.type());
    if (service.list(map).size()==0){
        map1.put("size",0);
    }else {
        map1.put("size",1);
    }
    return  map1;
    }
@RequestMapping("insert")
@ResponseBody
    public Integer insert(@RequestBody  Map map){
    return  service.insert(map);
}
@RequestMapping("del/{id}")
@ResponseBody
    public  Integer del(@PathVariable Map map){
    return  service.del(map);
    }
    @RequestMapping("update")
    @ResponseBody
    public  Integer update(@RequestBody Map map){
        return  service.update(map);
    }
    //修改人员评议状态
    @RequestMapping("upstate/{id}")
    @ResponseBody
    public  Integer upstate(@PathVariable Integer id ){
    return  service.upstate(id);
    }










}
